package com.young.common.client.log.configuration;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 日志文件采集客户端配置
 *
 * @author imrookie
 * @date 2018/11/19
 */
@Configuration
@ConditionalOnProperty(
        name = "young.log.client.file-log.enable",
        havingValue = "true",
        matchIfMissing = true
)
@ConfigurationProperties(prefix="young.log.client.file-log")
public class FileLogCollectConfiguration {
    private Boolean enable;//启用日志客户端
    private String logFileSavePath;//日志文件存储路径
    private boolean absolutePath;//是否绝对路径

    @Override
    public String toString() {
        return "LogCollectConfiguration{" +
                "enable=" + enable +
                ", logFileSavePath='" + logFileSavePath + '\'' +
                ", absolutePath=" + absolutePath +
                '}';
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    public String getLogFileSavePath() {
        return logFileSavePath;
    }

    public void setLogFileSavePath(String logFileSavePath) {
        this.logFileSavePath = logFileSavePath;
    }

    public boolean isAbsolutePath() {
        return absolutePath;
    }

    public void setAbsolutePath(boolean absolutePath) {
        this.absolutePath = absolutePath;
    }
}
